<?php

class vscitacisystemuprav extends view {
        var $title = "Úprav sćítací systém";
		var $scripts = array("jquery-1.9.1.min.js", "jquery.validate.js", "scitacisystemuprav.js");

        
        public function main(){     var_dump($this->data);
		echo "<h2>Úprava sčítacieho systému</h2>";
		echo  "<form action=\"/scitacisystem/uprav\" method=\"post\" id=\"upravss\">";
		
?>
		  <table>                                                                              
			   <!-- vytvor form  -->
				  <tr>
					<td><label for="menoss">Meno: </label></td>
					<td><input type="text" name="menoss" id="menoss" 
					    value="<?php if (isset($this->data['scitacisystem']->Meno)) echo $this->data['scitacisystem']->Meno; ?>" /></td>
				  </tr>
				  <tr></tr>
				  <tr>
					<td><label for="popisss">Popis: </label></td>
					<td><textarea name="popisss" id="popisss" rows="4" cols="50"><?php if (isset($this->data['scitacisystem']->Popis)) echo $this->data['scitacisystem']->Popis; ?></textarea></td>
				  </tr>
				  <tr>
					<td><label for="bodyod">Min. počet bodov:</label></td>
					<td><input type="text" name="bodyod" id="bodyod" 
					    value="<?php if (isset($this->data['scitacisystem']->Body_od)) echo $this->data['scitacisystem']->Body_od; ?>" /></td>
				  </tr>
				  <tr></tr>
				  <tr>
					<td><label for="bodydo">Max. počet bodov: </label></td>
					<td><input type="text" name="bodydo" id="bodydo" 
					    value="<?php if (isset($this->data['scitacisystem']->Body_do)) echo $this->data['scitacisystem']->Body_do; ?>" /></td>
				  </tr>
				  <tr></tr>
				  <tr><td><label for="zoradit">Zoradiť výsledky:</label></td>
					<td><input type="radio" name="zoradit" value="vzostupne" <?php if ($this->data['scitacisystem']->Zoradenie=='1'){echo'checked ';}?> />Vzostupne<br />
					<input type="radio" name="zoradit" value="zostupne" <?php if ($this->data['scitacisystem']->Zoradenie=='2'){echo'checked ';}?> />Zostupne</td></tr>
				  <tr>
					<td>
					  <input type="submit" name="uprav" value="Uprav" />
					</td>
				  </tr>
			   </table>
		  </form> 
<?php
		
		  if (isset($this->data['info'])){
			echo "<br /><p class='red'><b>".$this->data['info']."</b><p/>";
		  }	
		  echo '<br /><a href="/scitacisystem/vypis">Späť na výpis sčítacích systémov</a>';	
         }
}
?>